package infra

var apiInitializerRegister *InitializeRegister = new(InitializeRegister)

//注册WEB API初始化对象

func RegisterApi(api Initializer) {
	apiInitializerRegister.Register(api)
}

func GetApiInitializers() []Initializer {
	return apiInitializerRegister.Initializers
}

type WebApiStarter struct {
	BaseStarter
}

func (w *WebApiStarter) Setup(ctx StarterContext) {
	for _, v := range GetApiInitializers() {
		v.Init()
	}
}

//func (w *WebApiStarter) Start(ctx StarterContext){
//	time.Sleep(20*time.Second)
//}
